import request from '@/utils/request'

// 查询运单列表
export function listWaybill(query) {
  return request({
    url: '/tms/waybill/list',
    method: 'get',
    params: query
  })
}

// 初始化
export function initBean() {
    return request({
        url: '/tms/waybill/initBean',
        method: 'post'
    })
}

// 查询运单详细
export function getWaybill(id) {
  return request({
    url: '/tms/waybill/' + id,
    method: 'get'
  })
}

// 新增运单
export function addWaybill(data) {
  return request({
    url: '/tms/waybill',
    method: 'post',
    data: data
  })
}

// 修改运单
export function updateWaybill(data) {
  return request({
    url: '/tms/waybill',
    method: 'put',
    data: data
  })
}

// 删除运单
export function delWaybill(id) {
  return request({
    url: '/tms/waybill/' + id,
    method: 'delete'
  })
}


// 接单
export function receiveWaybill(id) {
  return request({
    url: '/tms/waybill/receive/' + id,
    method: 'post'
  })
}

// 装车
export function entruckWaybill(id) {
  return request({
    url: '/tms/waybill/entruck/' + id,
    method: 'post'
  })
}

// 发车
export function departWaybill(id) {
  return request({
    url: '/tms/waybill/depart/' + id,
    method: 'post'
  })
}

